Many computer programs, or applications, are very large. As a result, if the transport mechanism (e.g., network, disk drive) is slow, it may take a long time to load the application. In addition, when applications are loaded, the application may load code for features that are not necessary, before loading code that is necessary.
On modern operating systems, a program is typically brought into memory through a series of page fault operations, where each page fault is the result of attempting to access part of the program image that is been mapped from the image file, but not yet loaded into memory. Loading a program via page faults is efficient in terms of memory space. However, it is inefficient in terms of time.
Static analysis of programming code can be exploited to improve the average load time of a process, and/or minimize the number of I/O operations required just to run the program itself. In particular, the program image can be rearranged to group portions of code more efficiently. For example, if function A calls function B, the code for both functions should be in the same page. In addition, static data used by a function should be on the same page as the function itself, and a function with code and data that take less than a page of memory should not span a page boundary. Further, more frequently used functions should occur earlier in the image because file systems take less time to find, and thus load, the data from the beginning of a file than the data at the end of the file. However, the static analysis does not provide sufficient information for optimization of programs. For example, the static analysis does not determine which functions will be called during any particular invocation of a program.
Dynamic analysis such as profiling can also be used to analyze programs. A profiler is a tool that investigates a program's behavior using information gathered as the program runs. However, gathering of this information usually requires building or rebuilding the program, which has several limitations. In particular, when the application is rebuilt to provide the profiling information, the application is generally slower, and the functions are generally larger than they otherwise would have been.